#pragma once

#include "KnowledgeBaseElementInterface.h"

class KnowledgeBaseElement;
typedef Factory < KnowledgeBaseElementInterface >::CastedPtr < KnowledgeBaseElement > KnowledgeBaseElementPtr;

class KnowledgeBaseElement
: public KnowledgeBaseElementInterface
{
	friend class Factory < KnowledgeBaseElementInterface >;
public:
	static KnowledgeBaseElementInterfacePtr Spawn ( std::string lexemText );
	static void CheckInnocence ();
private:
	KnowledgeBaseElement ();
	virtual int SeniorKey ();
	virtual int SeniorType ();
	virtual std::string LexemText ();
	virtual bool UpperBranch ();
	virtual bool LowerBranch ();
	virtual int NextLevel ();
	virtual int Synonym ();
	virtual int AdjacentAscending ();
	virtual int AdjacentDescending ();
	virtual int BeforeAdjacentAscending ();
	virtual int BeforeAdjacentDescending ();
	virtual int GreaterAscending ();
	virtual int GreaterDescending ();
	virtual int LesserAscending ();
	virtual int LesserDescending ();
	virtual void SetSeniorKey ( int seniorKey );
	virtual void SetSeniorType ( int seniorType );
	virtual void SetUpperBranch ( bool upperBranch );
	virtual void SetLowerBranch ( bool lowerBranch );
	virtual void SetNextLevel ( int nextLevel );
	virtual void SetSynonym ( int synonym );
	virtual void SetAdjacentAscending ( int adjacentAscending );
	virtual void SetAdjacentDescending ( int adjacentDescending );
	virtual void SetBeforeAdjacentAscending ( int beforeAdjacentAscending );
	virtual void SetBeforeAdjacentDescending ( int beforeAdjacentDescending );
	virtual void SetGreaterAscending ( int greaterAscending );
	virtual void SetGreaterDescending ( int greaterDescending );
	virtual void SetLesserAscending ( int lesserAscending );
	virtual void SetLesserDescending ( int lesserDescending );
private:
	int seniorKey;
	int seniorType;
	std::string lexemText;
	bool upperBranch;
	bool lowerBranch;
	int nextLevel;
	int synonym;
	int adjacentAscending;
	int adjacentDescending;
	int beforeAdjacentAscending;
	int beforeAdjacentDescending;
	int greaterAscending;
	int greaterDescending;
	int lesserAscending;
	int lesserDescending;
	static Factory < KnowledgeBaseElementInterface > factory;
};
